<?php
use \phiction\tester as t;
use \firebase\jwt;

return [
    'jwt' => function () {
        $key = "phiction";
        $jwt = jwt::encode([
            'seq' => 1,
            'login' => 'root',
            'iss' => 'api.cjprods.org',
            'aud' => 'b.cjprods.org',
        ], $key);
        var_dump($jwt);

        $token = (array)jwt::decode($jwt, $key, ['HS256']);
        var_dump($token);
    },
    '!expired' => function () {
        $key = "phiction";
        $jwt = jwt::encode([ 'exp' => time() - 20 ], $key);
        var_dump($jwt);

        $token = (array)jwt::decode($jwt, $key, ['HS256']);
        var_dump($token);
    },
];

